import pygame
import sys
from init_map import InitMap


class Map(InitMap):
    def __init__(self, *args):
        InitMap.__init__(self)

        self.npc_man = pygame.image.load("../资源/图片/老头.png").convert_alpha()
        self.door_red = pygame.image.load("../资源/图片/红门.jpg").convert_alpha()
        self.prince_red = pygame.image.load("../资源/图片/红衣魔王.png").convert_alpha()

        self.hero_pos = (5, 0)
        self.up_pos = (5, 7)
        self.down_pos = (6, 0)
        self.variable_pos = {
            (5, 3): (self.door_red, '红门'),
            (4, 4): (self.npc_man, '冰之灵杖'),
            (5, 5): (self.prince_red, '红衣魔王'),
        }

    def fixed_brick(self):
        self.draw(self.upstairs, self.up_pos[0], self.up_pos[1])
        self.dic[self.up_pos] = '上楼'
        self.draw(self.downstairs, self.down_pos[0], self.down_pos[1])
        self.dic[self.down_pos] = '下楼'
        for i in range(11):
            for j in range(11):
                if i != 5 and not (i, j) == (6, 0):
                    self.draw(self.wall, i, j)
                    self.dic[(i, j)] = '墙'
        for i in range(3):
            self.draw(self.wall, 5, i+8)
            self.dic[(5, i+8)] = '墙'
        for i in self.ls:
            self.screen.blit(self.road, i)
            self.dic[(int((i[0]-375)/48), int((i[1]-25)/48))] = '路'
